package com.ilongsay.utils;

/**
 * @Author ilongsay
 * @Email ilongsay@163.com
 * @Copyright 版本所有，侵权必究！
 * @Datetime 2018-11-12 22:15
 * @Describution
 */
public class DynamicDataSourceHolder {
    //private static final ThreadLocal<String> dataSourceKey = new InheritableThreadLocal<String>();
    private static final ThreadLocal<String> dataSourceKey = new ThreadLocal<String>();

    public static String getDataSource() {
        return dataSourceKey.get();
    }


    public static void setDataSource(String dataSource) {
        dataSourceKey.set(dataSource);
    }


    public static void clearDataSource() {
        dataSourceKey.remove();
    }
}
